package com.spc.travel.agency.mvp.ui.activity;

import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.anno.spc.ActivityInject;
import com.spc.travel.agency.R;
import com.travel.lib.base.BaseMVPActivity;
import com.spc.travel.agency.mvp.iview.MainAcView;
import com.spc.travel.agency.mvp.presenter.MainPresenter;
import com.spc.travel.agency.mvp.ui.fragment.IndexFragment;

import butterknife.BindView;
import butterknife.OnClick;

@ActivityInject
public class MainActivity extends BaseMVPActivity<MainPresenter> implements MainAcView {

    @BindView(R.id.mtv)
    TextView mtv;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mtv.setText("asdfasfdsadfasdfasdfasdf");
        getSupportFragmentManager().beginTransaction().replace(R.id.mFrame, new IndexFragment()).commit();
        mvpPresenter.lodData();

    }

    @OnClick(R.id.mtv)
    public void onViewClicked() {
        Toast.makeText(this, "asdfasfda", Toast.LENGTH_SHORT).show();
    }


    @Override
    public void getDataSuccess() {
        Toast.makeText(this, "666666", Toast.LENGTH_SHORT).show();
    }
}
